<?php

$section = 'gallery';
$titre = _LB_GALLERY_MANAGEMENT;
$smarty->assign('titre', $titre);

$id = Request::getIntNumber('id');
$backlink = Session::getBackLink('gallery');
$currentlink = APPLICATION_URL . "/gallery/delete/?id=". $id;

$album = new Album();
if(!$album->get($id))
	redirect($backlink);
$album_gallery = new Album_Gallery();
$album_gallery->ID_ALBUM = $id;
$album_gallery->find();
if($album_gallery->N > 0){
    redirect($backlink);
}
$album->delete();
redirect($backlink);